import {defineStore} from "pinia";
import {ref} from "vue";

export const useGoodsStore = defineStore('goods', () =>{
    // 商品数据
    const goodsList = ref([])
    const setGoodsList = (goods) => {
      goodsList.value = goods
    }
    // 热销产品
    const hotList = ref([
        {
            id: 1,
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp.jpg",
            name: "奶茶",
            title: 20,
            alt: '推荐'
        },
        {
            id: 2,
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp.jpg",
            name: "奶茶",
            title: 20,
            alt: '推荐'
        },
        {
            id: 3,
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp.jpg",
            name: "奶茶",
            title: 20,
            alt: '推荐'
        },
        {
            id: 4,
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp.jpg",
            name: "奶茶",
            title: 20,
            alt: '推荐'
        }
    ])
    // 推荐产品
    const productList = ref([
        {id: "1005000",
        name: "居家",
        picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/d0176b163973961ed01818d04ee94a06.png",
        saleInfo: "大额优惠\r\n等你来拿"
        }])
    // 推荐产品项目
    const goodsPro = ref([
        {
            id: "1183010",
            name: "给衣柜减减肥，真空防潮压缩袋",
            desc: "手动压缩，节省空间",
            price: "79.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/c25af46c2d3df0cbf933dd31c5e7ad6a.jpg",
            orderNum: 67
        },
        {
            id: "1108008",
            name: "爆款明星好物，抽屉式透明储物柜",
            desc: "抽屉随意拉，东西随意拿，7款尺寸，随意叠加搭配",
            price: "129.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/9892cc73945da1591fa5259ad076b23c.jpg",
            orderNum: 4234
        },
        {
            id: "4001920",
            name: "朱炳仁铜·猫型吉祥物装饰工艺摆件",
            desc: "灵性十足的黑色招财猫，周而复始，财源不断",
            price: "1888.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/76a5304c9d7378a83e63554f3077d98b.png",
            orderNum: 3781
        },
        {
            id: "4001880",
            name: "朱炳仁·铜彩色生肖铜雕摆件",
            desc: "十二生肖萌宝系列吉祥物，吉祥又好运",
            price: "680.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/6e38fc94a8fe72c9d139bc48ba6d9814.jpg",
            orderNum: 17758
        },
        {
            id: "1028004",
            name: "衣柜省空间神器，棉麻涤·收纳挂袋",
            desc: "实用棉麻，悬挂牢固",
            price: "55.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/49e21db0fe13c0ff1789a79a8ba48468.jpg",
            orderNum: 3078
        },
        {
            id: "4000295",
            name: "星云吉彩系列花器新年创意花瓶摆件朱炳仁",
            desc: "星云吉彩，一路繁花。花瓶造型挺秀、俏丽，更为丰满圆润；五彩斑斓色彩，莹润光泽的质感，又显娇嫩。置于台前感受花与花器的和谐之美，获得精神的美感和愉悦。采用国家非遗百年传统工艺及国艺釉彩铜独创工艺，简约时尚的设计，雅致意趣。",
            price: "442.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/2dd8fe9b59774c7ca160bb2d5741c763.jpg",
            orderNum: 6529
        },
        {
            id: "3997602",
            name: "暖腰暖腹暖胃，蕲艾暖宫腰带",
            desc: "暖宫暖腰暖胃，大面积热敷≈3片暖宝宝",
            price: "49.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/06461cea9e56b56dd4276e1cb81dd884.png",
            orderNum: 102
        },
        {
            id: "4001798",
            name: "海洋之歌·艺术雕塑摆件",
            desc: "白夜通话番外系列《海洋之歌》，温暖治愈",
            price: "67.00",
            picture: "https://sky-takeout-ximeng.oss-cn-hangzhou.aliyuncs.com/sp/04753036f123a8ff1b56db60fe440f47.jpg",
            orderNum: 7581
        }
    ])
    return {
        goodsList,
        hotList,
        productList,
        goodsPro,
        setGoodsList
    }
}, {
    persist: ["goodsList"]
})

